package com.yuyou.fn.tms.vo;

import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;

import javax.validation.Valid;
import javax.validation.constraints.DecimalMin;
import javax.validation.constraints.Min;
import javax.validation.constraints.NotNull;
import java.math.BigDecimal;
import java.util.List;

@ApiModel("保存订单对象")
@JsonIgnoreProperties(ignoreUnknown = true)
public class SaveOrderParam extends RequestParam {

    @ApiModel("报名对象")
    @JsonIgnoreProperties(ignoreUnknown = true)
    public static class Reg {

        @ApiModelProperty("应缴")
        @DecimalMin("0")
        @NotNull
        private BigDecimal regPrice ;//应缴

        @ApiModelProperty("优惠金额")
        @DecimalMin("0")
        @NotNull
        private BigDecimal regDiscount ;//优惠金额

        @ApiModelProperty("实缴")
        @DecimalMin("0")
        @NotNull
        private BigDecimal regPayPrice ;//实缴

        @ApiModelProperty("班级id")
        @NotNull
        private Long claId ;//班级id

        @ApiModelProperty("报名开始讲次")
        @Min(1)
        private int claStartNum ;//报名开始讲次

        @ApiModelProperty("报名结束讲次")
        @Min(1)
        private int claEndNum ;//报名结束讲次

        @ApiModelProperty("缴费开始讲次")
        @Min(1)
        private int claPayStartNum ;//缴费开始讲次

        @ApiModelProperty("缴费结束讲次")
        @Min(1)
        private int claPayEndNum ;//缴费结束讲次

        public BigDecimal getRegPrice() {
            return regPrice;
        }

        public void setRegPrice(BigDecimal regPrice) {
            this.regPrice = regPrice;
        }

        public BigDecimal getRegDiscount() {
            return regDiscount;
        }

        public void setRegDiscount(BigDecimal regDiscount) {
            this.regDiscount = regDiscount;
        }

        public BigDecimal getRegPayPrice() {
            return regPayPrice;
        }

        public void setRegPayPrice(BigDecimal regPayPrice) {
            this.regPayPrice = regPayPrice;
        }

        public Long getClaId() {
            return claId;
        }

        public void setClaId(Long claId) {
            this.claId = claId;
        }

        public int getClaStartNum() {
            return claStartNum;
        }

        public void setClaStartNum(int claStartNum) {
            this.claStartNum = claStartNum;
        }

        public int getClaEndNum() {
            return claEndNum;
        }

        public void setClaEndNum(int claEndNum) {
            this.claEndNum = claEndNum;
        }

        public int getClaPayStartNum() {
            return claPayStartNum;
        }

        public void setClaPayStartNum(int claPayStartNum) {
            this.claPayStartNum = claPayStartNum;
        }

        public int getClaPayEndNum() {
            return claPayEndNum;
        }

        public void setClaPayEndNum(int claPayEndNum) {
            this.claPayEndNum = claPayEndNum;
        }
    }

    @ApiModel("优惠对象")
    @JsonIgnoreProperties(ignoreUnknown = true)
    public static class Discount {

        @ApiModelProperty("班级id")
        @NotNull
        private Long claId ;

        @ApiModelProperty("优惠名称")
        @NotNull
        private String rDisName ;//优惠名称

        @ApiModelProperty("优惠方式（1每科减2订单减3折扣）")
        @NotNull
        private int rDisStyle ;//优惠方式

        @ApiModelProperty("优惠id")
        @NotNull
        private Long rDisDisId ;//优惠id

        @ApiModelProperty("优惠金额")
        @DecimalMin("0")
        @NotNull
        private BigDecimal rDisMoney ;//优惠金额

        @ApiModelProperty("优惠方式对应的值")
        @DecimalMin("0")
        @NotNull
        private BigDecimal rDisVal ;//优惠方式对应的值

        @ApiModelProperty("对应优惠码")
        private String couponCode ;//对应优惠码

        public Long getClaId() {
            return claId;
        }

        public void setClaId(Long claId) {
            this.claId = claId;
        }

        public String getrDisName() {
            return rDisName;
        }

        public void setrDisName(String rDisName) {
            this.rDisName = rDisName;
        }

        public int getrDisStyle() {
            return rDisStyle;
        }

        public void setrDisStyle(int rDisStyle) {
            this.rDisStyle = rDisStyle;
        }

        public Long getrDisDisId() {
            return rDisDisId;
        }

        public void setrDisDisId(Long rDisDisId) {
            this.rDisDisId = rDisDisId;
        }

        public BigDecimal getrDisMoney() {
            return rDisMoney;
        }

        public void setrDisMoney(BigDecimal rDisMoney) {
            this.rDisMoney = rDisMoney;
        }

        public BigDecimal getrDisVal() {
            return rDisVal;
        }

        public void setrDisVal(BigDecimal rDisVal) {
            this.rDisVal = rDisVal;
        }

        public String getCouponCode() {
            return couponCode;
        }

        public void setCouponCode(String couponCode) {
            this.couponCode = couponCode;
        }
    }

    @ApiModel("订单对象")
    @JsonIgnoreProperties(ignoreUnknown = true)
    public static class Order {

        @ApiModelProperty("订单金额")
        @DecimalMin("0")
        @NotNull
        private BigDecimal finOrderPrice ;//订单金额

        @ApiModelProperty("订单实缴金额")
        @DecimalMin("0")
        @NotNull
        private BigDecimal finOrderPayPrice ;//订单实缴金额

        @ApiModelProperty("订单缴费类型1现金2pos4转账8账户16支票 32微信 64支付宝  插入时多种支付方式或运算")
        @NotNull
        private int finOrderPayType ;//订单缴费类型1现金2pos4转账8账户16支票 32微信 64支付宝  插入时多种支付方式或运算

        @ApiModelProperty("优惠金额")
        @DecimalMin("0")
        @NotNull
        private BigDecimal finOrderDis ;//优惠金额

        @ApiModelProperty("推荐人，对应誉优student_reg中的counselor_id")
        private Long finOrderAdvisorId ;//推荐人，对应誉优student_reg中的counselor_id

        @ApiModelProperty("推荐人姓名对应誉优student_reg中的counselor_name")
        private String finOrderAdvisorName ;//推荐人姓名对应誉优student_reg中的counselor_name

        public BigDecimal getFinOrderPrice() {
            return finOrderPrice;
        }

        public void setFinOrderPrice(BigDecimal finOrderPrice) {
            this.finOrderPrice = finOrderPrice;
        }

        public BigDecimal getFinOrderPayPrice() {
            return finOrderPayPrice;
        }

        public void setFinOrderPayPrice(BigDecimal finOrderPayPrice) {
            this.finOrderPayPrice = finOrderPayPrice;
        }

        public int getFinOrderPayType() {
            return finOrderPayType;
        }

        public void setFinOrderPayType(int finOrderPayType) {
            this.finOrderPayType = finOrderPayType;
        }

        public BigDecimal getFinOrderDis() {
            return finOrderDis;
        }

        public void setFinOrderDis(BigDecimal finOrderDis) {
            this.finOrderDis = finOrderDis;
        }

        public Long getFinOrderAdvisorId() {
            return finOrderAdvisorId;
        }

        public void setFinOrderAdvisorId(Long finOrderAdvisorId) {
            this.finOrderAdvisorId = finOrderAdvisorId;
        }

        public String getFinOrderAdvisorName() {
            return finOrderAdvisorName;
        }

        public void setFinOrderAdvisorName(String finOrderAdvisorName) {
            this.finOrderAdvisorName = finOrderAdvisorName;
        }
    }

    @ApiModel("支付对象")
    @JsonIgnoreProperties(ignoreUnknown = true)
    public static class PayInfo {



        @ApiModelProperty("支付金额")
        @DecimalMin("0")
        @NotNull
        private BigDecimal fopPay ;//支付金额

        @ApiModelProperty("支付类型，1现金2pos4转账8账户16支票 32微信 64支付宝")
        @NotNull
        private int fopType ;//支付类型，1现金2pos4转账8账户16支票 32微信 64支付宝

        @ApiModelProperty("支付流水号")
        private String finaPayNo ;//支付流水号

        public BigDecimal getFopPay() {
            return fopPay;
        }

        public void setFopPay(BigDecimal fopPay) {
            this.fopPay = fopPay;
        }

        public int getFopType() {
            return fopType;
        }

        public void setFopType(int fopType) {
            this.fopType = fopType;
        }

        public String getFinaPayNo() {
            return finaPayNo;
        }

        public void setFinaPayNo(String finaPayNo) {
            this.finaPayNo = finaPayNo;
        }
    }

    @NotNull
    @Valid
    private List<Reg> regs;

    @NotNull
    @Valid
    private List<Discount> discounts ;

    @NotNull
    @Valid
    private Order order ;

    @NotNull
    @Valid
    private List<PayInfo> payInfos ;

    @NotNull
    private Long stuId ;

    public List<Reg> getRegs() {
        return regs;
    }

    public void setRegs(List<Reg> regs) {
        this.regs = regs;
    }

    public List<Discount> getDiscounts() {
        return discounts;
    }

    public void setDiscounts(List<Discount> discounts) {
        this.discounts = discounts;
    }

    public Order getOrder() {
        return order;
    }

    public void setOrder(Order order) {
        this.order = order;
    }

    public List<PayInfo> getPayInfos() {
        return payInfos;
    }

    public void setPayInfos(List<PayInfo> payInfos) {
        this.payInfos = payInfos;
    }

    public Long getStuId() {
        return stuId;
    }

    public void setStuId(Long stuId) {
        this.stuId = stuId;
    }
}
